import com.kkb.mapper.UserMapper;
import com.kkb.pojo.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * @author:CoolTiger
 * @title: test
 * @projectName ssm_hospital
 * @description: TODO
 * @date:2022/07/08/11:21:47
 **/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class test {
    @Autowired
    private UserMapper userMapper;
    @Test
    public void test(){
        List<User> users = userMapper.selectByExample(null);
        users.forEach(user -> System.out.println(user));
    }
    @Test
    public void test2(){
        User user = new User();
        user.setuPassword("123");
        user.setuLoginname("admin");


        System.out.println( userMapper.queryUser(user));
    }
    @Test
    public void testtime(){
        Integer  timeNew = Math.toIntExact(System.currentTimeMillis() / 10000); // 10位数的时间戳
        long  timeNew2 =  System.currentTimeMillis(); // 13位数的时间戳
        int randomNum = (int)((Math.random()*9+1)*100000); // 随机数 6 位
        System.out.println(timeNew);
        System.out.println(timeNew2);
        System.out.println(randomNum);
    }
}
